/***********************************************************************
 *
 * MODULE NAME:    hfp.h
 * DESCRIPTION:    interface for Headset and Handfree profile
 * AUTHOR:         Martin Mellody
 *
 * SOURCE CONTROL: $Id: hfp.h,v 1.1 2008/01/03 06:55:12 tianwq Exp $
 *
 * LICENSE:
 *     This source code is copyright (c) 2000-2011 RDA Microelectronics.
 *     All rights reserved.
 *
 ***********************************************************************/
#ifndef __HFP_H__
#define __HFP_H__

/*********************************************
 * HFP Class of Device                     
 *********************************************/
#define HANDS_FREE_UNIT_COD     0x200408
#define HANDS_FREE_AG_COD       0x200408
#define HEADSET_UNIT_COD        0x200404
#define HEADSET_AG_COD          0x200404


#define ACTIVE_PROFILE_HEADSET            0x01
#define ACTIVE_PROFILE_HEADSET_AG         0x02
#define ACTIVE_PROFILE_HANDSFREE          0x04
#define ACTIVE_PROFILE_HANDSFREE_AG       0x08

/* second argument of HF_Call_Request */
enum call_type {
    /* use by HF_Call_Request */
	HF_CALL_INCOMMING,
	HF_CALL_OUTGOING,
	HF_CALL_START,
	HF_CALL_ALERT,
	HF_CALL_RELEASE,
	HF_CALL_NUM,
	HF_CALL_MEM,
	HF_CALL_REDIAL,

    /* use by HF_Call_Answer */
	HF_CALL_ACCEPT,
	HF_CALL_REJECT,

    /* use by HF_Call_Hold */
	HF_CALL_HELD,
	HF_CALL_WAIT,
	
    /* use by HF_Call_Status */
    HF_SERVICE_INDICATOR,
    HF_CALL_INDICATOR,
    HF_CALLSETUP_INDICATOR,
    HF_CALLHOLD_INDICATOR,
    HF_BATTCHG_INDICATOR,
    HF_SIGNAL_INDICATOR,
    HF_ROAM_INDICATOR,

    /* use by HF_Voice_Recognition */
    HF_VR_START,
    HF_VR_STOP
};



/*Bits for HF_Multiparty_Call_Handling() */
typedef enum{
	PARTY_CURR_ACTIVE_OTHER_DISMISS	= 0,
	PARTY_CURR_RELEASE_OTHER_ACCEPT,
	PARTY_CURR_HOLD_OTHER_ACCEPT,
	PARTY_JOIN_3WAY,
	PARTY_LEAVE_3WAY
} HF_PART_CALL_TYPE;

typedef struct
{
    t_bdaddr       bt_addr;
    u_int16        connection_id;  
    u_int8         profile;
    u_int8         result;
} t_hfp_connect_ind;

typedef struct
{
    u_int8 	       gain;
    u_int8         profile;
    u_int16        connection_id;
} t_hfp_gain_ind;


typedef struct 
{
    u_int8         type;
    u_int16        connection_id;
} t_hfp_call_ind;

#ifdef __cplusplus
extern "C" {
#endif


APIDECL1 t_api APIDECL2 HF_Activate(u_int8 active_profile);
APIDECL1 t_api APIDECL2 HF_Deactivate(u_int8 active_profile);
APIDECL1 t_api APIDECL2 HF_Connect_SLC(t_bdaddr device_addr, u_int8 active_profile);
APIDECL1 t_api APIDECL2 HF_Accept_SLC(t_bdaddr ag_bdaddr);
APIDECL1 t_api APIDECL2 HF_Reject_SLC(t_bdaddr ag_bdaddr);
APIDECL1 t_api APIDECL2 HF_Release_SLC(t_bdaddr ag_bdaddr);

APIDECL1 t_api APIDECL2 HF_ServiceDiscover(t_bdaddr address, u_int8 active_profile);

APIDECL1 u_int APIDECL2 HF_Get_Current_Profile(void);
APIDECL1 u_int APIDECL2 HF_Get_Device_State(void);
APIDECL1 u_int APIDECL2 HF_Get_Current_Call_Status(void);
APIDECL1 t_api APIDECL2 HF_Get_Current_BdAddr(t_bdaddr *addr);

APIDECL1 t_api APIDECL2 HF_Send_Raw_Data(u_int8 *data, int dataLen);

APIDECL1 t_api APIDECL2 HF_Send_Mic_Gain(u_int8 gain) ;
APIDECL1 t_api APIDECL2 HF_Send_Speaker_Gain(u_int8 gain);

APIDECL1 t_api APIDECL2 HF_Send_Button_Press(void);

APIDECL1 t_api APIDECL2 HF_Set_Number(u_int8 *number);

APIDECL1 t_api APIDECL2 HF_Call_Request(u_int8 type, u_int8 mode);
APIDECL1 t_api APIDECL2 HF_Call_Answer(u_int8 type);
APIDECL1 t_api APIDECL2 HF_Call_Hold(u_int8 type);
APIDECL1 t_api APIDECL2 HF_Call_Status(u_int8 type, u_int8 value);
APIDECL1 t_api APIDECL2 HF_Voice_Recognition(u_int8 type);

#ifdef __cplusplus
} /* extern "C" { */
#endif

#endif

